classdef NewPortLBP2 < handle
    %NEWFOCUSLBP2 Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
        pixelSize
        imageData
    end
    
    methods
        function obj = NewPortLBP2()
            obj.pixelSize = 3.69; %um
        end
        
        function data= readImage(obj, filename)
            name = sprintf('%s.lbp2Data', filename);
            h = h5read(name,'/BG_DATA/1/RAWFRAME/HEIGHT');
            w = h5read(name,'/BG_DATA/1/RAWFRAME/WIDTH');
            data = reshape(h5read(name,'/BG_DATA/1/DATA'), w, h).';
            obj.imageData = data;
        end
        
        function data = showImage(obj, filename)
            data = obj.readImage(filename);
            I = mat2gray(data);
            colormap('jet');
            imagesc([0 size(I, 2)*obj.pixelSize], [0 size(I, 1)*obj.pixelSize], I);
        end
        
    end
end

